<?php
namespace Test\Controller;

use Think\Controller;
use Api\Service\OAuth2ClientService;


/**
 * Created by PhpStorm.
 * User: an
 * Date: 2015/8/11
 * Time: 17:44
 */
class TestController extends  Controller
{
    protected $api_ver;
    protected $notify_id;

    public function _initialize(){
        header("X-AUTHOR:ITBOYE.COM");
        $client_id = CLIENT_ID;
        $client_secret = CLIENT_SECRET;
        $config = array(
            'client_id'=>$client_id,
            'client_secret'=>$client_secret,
            'site_url'=>C("SITE_URL"),
        );

        $client = new OAuth2ClientService($config);
        $access_token = $client->getAccessToken();

        if($access_token['status']){
            $this->assign("access_token",$access_token['info']);
        }
        $this->api_ver = I('post.api_ver',0);
        $this->notify_id = I('post.notify_id',time());
        $this->assign("error",$access_token);
    }



}